<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">

        <div><?php include "../public_flow/flow_show_info.php";?></div>

        <div class="table-box tablenes">
            <div class="title">项目信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">项目名称</td><td id="enginname" class="colorlan tv"></td><td class="tt">委托方</td><td id="lian_unit" class="tv"></td></tr>
                </tbody>
            </table>
        </div>
        <div class="table-box tablenes">
            <div class="title">项目资金情况</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">施工合同金额(元)</td><td id="shimoney" class="tv"></td><td class="tt">累计收款金额(元)</td><td id="incomeenginfee" class="tv"></td></tr>
                <tr><td class="tt">累计付款(元)</td><td id="payenginfee" class="tv"></td><td class="tt">累计扣款(元)</td><td id="neikoufee" class="tv"></td></tr>
                <tr><td class="tt">累计项目费用报销(元)</td><td id="paybaofee" class="tv" colspan="3"></td></tr>
                <tr><td class="tt">累计结算支付(元)</td><td id="payment_xiangfu" class="tv"></td><td class="tt">项目余额(元)</td><td id="balance" class="tv"></td></tr>
                <tr><td class="tt">累计待扣(元)</td><td id="leikoudai" class="tv"></td><td class="tt">项目可用余额(元)</td><td id="shengjiefee" class="tv"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes short_table_list_cur">
            <div class="title">项目应扣费用情况</div>
            <table class="layui-table">
                <thead>
                <tr>
                    <th colspan="4" style="text-align: center">管理费(元)</th>
                    <th colspan="4" style="text-align: center">成本票差额费(元)</th>
                    <th colspan="3" style="text-align: center">税费(元)</th>
                    <th colspan="3" style="text-align: center">税费利息(元)</th>
                    <th rowspan="2">应扣合计(元)</th>
                    <th rowspan="2">已扣合计(元)</th>
                    <th rowspan="2">待扣合计(元)</th>
                </tr>
                <tr>
                    <th>比例%</th>
                    <th>应扣</th>
                    <th>已扣</th>
                    <th>待扣</th>


                    <th>比例%</th>
                    <th>应扣</th>
                    <th>已扣</th>
                    <th>待扣</th>

                    <th>应扣</th>
                    <th>已扣</th>
                    <th>待扣</th>

                    <th>应扣</th>
                    <th>已扣</th>
                    <th>待扣</th>
                </tr>
                </thead>
                <tbody id="koukuaninfo">

                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">本次扣款信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">扣款编号</td><td class="tv" id="number" colspan="3"></td></tr>
                <tr><td class="tt">扣款名称</td><td id="zhai" class="tv" colspan="3"></td></tr>
                <tr><td class="tt">扣款金额(元)</td><td id="money" class="tv"></td><td class="tt">核算日期</td><td id="dt" class="tv"></td></tr>

                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>

        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo">扣款明细</script>
            <div class="tableShow">
                <table id="datalist" lay-filter="datalist"></table>
            </div>
        </div>


        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_payment_neikou_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;
                var engininfo = res.data.engininfo;

                if(engininfo){
                    $("#enginname").text(engininfo.name).click(function () {
                        openPage('../engin/show.php?id='+engininfo.id);
                    });

                    $("#lian_unit" ).text(engininfo.lian_unit);
                    $("#shimoney" ).text(engininfo.shimoney);
                    $("#incomeenginfee" ).text(engininfo.incomeenginfee || 0);
                    $("#payenginfee" ).text(engininfo.payenginfee);
                    $("#paybaofee" ).text(engininfo.paybaofee);
                    $("#neikoufee" ).text(engininfo.neikoufee);
                    $("#payment_xiangfu" ).text(engininfo.payment_xiangfu);
                    $("#balance" ).text(engininfo.balance);
                    $("#leikoudai" ).text(engininfo.leikoudai);
                    $("#shengjiefee" ).text(engininfo.shengjiefee);

                    var str = '';
                    str += '<tr>';
                    str += '<td>'+engininfo.guanrate+'</td>';
                    str += '<td>'+engininfo.guanying+'</td>';
                    str += '<td>'+engininfo.guanyi+'</td>';
                    str += '<td>'+engininfo.guandai+'</td>';



                    str += '<td>'+engininfo.charate+'</td>';
                    str += '<td>'+engininfo.chaying+'</td>';
                    str += '<td>'+engininfo.chayi+'</td>';
                    str += '<td>'+engininfo.chadai+'</td>';

                    str += '<td>'+engininfo.shuiying+'</td>';
                    str += '<td>'+engininfo.shuiyi+'</td>';
                    str += '<td>'+engininfo.shuidai+'</td>';

                    str += '<td>'+engininfo.lixiying+'</td>';
                    str += '<td>'+engininfo.lixiyi+'</td>';
                    str += '<td>'+engininfo.lixidai+'</td>';

                    str += '<td>'+engininfo.ying_all+'</td>';
                    str += '<td>'+engininfo.yi_all+'</td>';
                    str += '<td>'+engininfo.dai_all+'</td>';
                    str += '</tr>';
                    $("#koukuaninfo").html(str);
                }





                $("#number").text(data.number);
                $("#money").text(data.money);
                $("#dt").text(data.dt);
                $("#zhai").text(data.zhai);
                $("#explain").text(data.explain);




                var mytableList = table.render({
                    elem: "#datalist",data:res.data.list, toolbar: '#toolbarDemo', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号',fixed:'left'}
                        ,{field: 'feitype', title: '费用项'}
                        ,{field: 'money', title: '本次扣款(元)'}
                        ,{field: 'explain', title: '备注'}
                    ]]
                    , done: function (res) {
                        soulTable.render(this);
                    }
                });


                // $(".pageshowtitle").text('扣款登记');

                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('payment_neikou', param_id);
    });



</script>
</body>
</html>




